#include <stm8s_clk.h>

void CLK_HSICmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONALSTATE_OK(NewState));
  
  if (NewState != DISABLE)
  {
    /* Set HSIEN bit */
    CLK->ICKR |= CLK_ICKR_HSIEN;
  }
  else
  {
    /* Reset HSIEN bit */
    CLK->ICKR &= (uint8_t)(~CLK_ICKR_HSIEN);
  }
}

/**
  * @brief  Enables or disables the Internal Low Speed oscillator (LSI).
  * @param  NewState new state of LSIEN, value accepted ENABLE, DISABLE.
  * @note   Before using the LSI clock you have to enable the option bytes (LSI_EN option bit is set).
  * @retval None
  */
